<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改课程安排主')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-arrangement-edit" th:object="${courseArrangement}">
            <input name="arrangementId" th:field="*{arrangementId}" type="hidden">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">课程：</label>
                    <div class="col-sm-8">
<!--                        <input name="courseId" th:field="*{courseId}" class="form-control" type="text" required>-->
                        <select name="courseId" class="form-control">
                            <option th:each="course:${courses}" th:value="${course.courseId}" th:text="${course.courseName}" th:selected="${courseArrangement.courseId == course.courseId}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">学期：</label>
                    <div class="col-sm-8">
<!--                        <input name="semesterId" th:field="*{semesterId}" class="form-control" type="text" required>-->
                        <select name="semesterId" class="form-control">
                            <option th:each="semester:${semesters}" th:value="${semester.semesterId}" th:text="${semester.semesterName}" th:selected="${courseArrangement.semesterId == semester.semesterId}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">课程负责人：</label>
                    <div class="col-sm-8">
<!--                        <input name="leaderId" th:field="*{leaderId}" class="form-control" type="text" required>-->
                        <select name="leaderId" class="form-control">
                            <option th:each="teacher:${teachers}" th:value="${teacher.teacherId}" th:text="${teacher.teacherName}" th:selected="${courseArrangement.leaderId == teacher.teacherId}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">选取状态：</label>
                    <div class="col-sm-8">
                        <select name="status" class="form-control" th:with="type=${@dict.getType('sys_arrangement_status')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{status}"></option>
                        </select>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "college/arrangement";
        $("#form-arrangement-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-arrangement-edit').serialize());
            }
        }
    </script>
</body>
</html>